package PTA.javaA;

import java.util.Scanner;

class ArrayUtils{
     PairResult findMinMax(double[] str){
PairResult a= new PairResult();
double min = str[0];
double max = str[0];
for(int i=0;i<str.length;i++){
    if(str[i]>max){
        max=str[i];
    }else if(str[i]<min){
        min=str[i];
    }
}
a.setMax(max);
a.setMin(min);
return a;
    }
    static class PairResult{
        private double min;
        private double max;

        public double getMin() {
            return min;
        }

        public void setMin(double min) {
            this.min = min;
        }

        public double getMax() {
            return max;
        }

        public void setMax(double max) {
            this.max = max;
        }

        @Override
        public String toString() {
            return "PairResult [min=" + min + ", max=" + max + "]";

        }


    }
}
public class ex23 {
    public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
double str[] = new double[n];
for(int i=0;i<n;i++){
    str[i]=sc.nextDouble();
}
        ArrayUtils ith = new ArrayUtils();
        System.out.println(ith.findMinMax(str).toString());
        System.out.println(ArrayUtils.PairResult.class);










    }
}
